import { createRouter, createWebHistory } from 'vue-router'
import UserLoginPage from '@/pages/user/UserLoginPage.vue'
import AppChatPage from '@/pages/app/AppChatPage.vue'
import AppEditPage from '@/pages/app/AppEditPage.vue'
import AppManagePage from '@/pages/admin/AppManagePage.vue'
import ChatManagePage from '@/pages/admin/ChatManagePage.vue'


const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: () => import('@/pages/HomePage.vue')
    },

    {
      path: '/user/login',
      name: 'user-login',
      component: () => import('@/pages/user/UserLoginPage.vue')
    },
    {
      path: '/user/register',
      name: 'user-register',
      component: () => import('@/pages/user/UserRegisterPage.vue')
    },
    {
      path: '/user/edit',
      name: 'user-edit',
      component: () => import('@/pages/user/UserEditPage.vue')
    },
    {
      path: '/admin/userManage',
      name: 'admin-user',
      component: () => import('@/pages/admin/UserManagePage.vue')
    },
    {
      path: '/admin/appManage',
      name: '应用管理',
      component: AppManagePage,
    },
    {
      path: '/app/chat/:id',
      name: '应用对话',
      component: AppChatPage,
    },
    {
      path: '/app/edit/:id',
      name: '编辑应用',
      component: AppEditPage,
    },
    {
      path: '/admin/chatManage',
      name: '对话管理',
      component: ChatManagePage,
    },

  ]
})

export default router
